package com.yingxin.yxerp.module.sys.entity.enums;

/**
 * 发票类型枚举
 */
public enum InvoiceTypeEnums {

    FP("FP", "普通(纸质)发票"),
    FZ("FZ", "专用(纸质)发票"),
    FD("FD", "定额(纸质)发票"),

    DP("DP", "普通(电子)发票"),
    DZ("DZ", "专用(电子)发票"),

    SJ("SJ", "收据");

    private String invoiceType;

    private String invoiceTypeName;

    InvoiceTypeEnums(String invoiceType, String invoiceTypeName) {
        this.invoiceType = invoiceType;
        this.invoiceTypeName = invoiceTypeName;
    }

    public String getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(String invoiceType) {
        this.invoiceType = invoiceType;
    }

    public String getInvoiceTypeName() {
        return invoiceTypeName;
    }

    public void setInvoiceTypeName(String invoiceTypeName) {
        this.invoiceTypeName = invoiceTypeName;
    }

    public static InvoiceTypeEnums getEnum(String invoiceType) {
        for (InvoiceTypeEnums i : InvoiceTypeEnums.values()) {
            if (i.getInvoiceType().equals(invoiceType)) {
                return i;
            }
        }
        return null;
    }
}
